import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
import "lib-flexible/flexible";

const app = createApp(App);

import vant from 'vant';
import { Icon } from 'vant';
import 'vant/lib/index.css';


import TitleGroup from "@/views/components/title-group/title-group.vue";
import LinkBottonGroup from "@/views/components/link-bottom-group/link-bottom-group.vue";
app.component("TitleGroup", TitleGroup);
app.component("LinkBottonGroup", LinkBottonGroup);

// 最小值
Array.prototype.min = function () {
  let min = this[0];
  let len = this.length;
  for (let i = 1; i < len; i++) {
    if (this[i] < min) min = this[i];
  }
  return min;
};
// 最大值
Array.prototype.max = function () {
  let max = this[0];
  let len = this.length;
  for (let i = 1; i < len; i++) {
    if (this[i] > max) max = this[i];
  }
  return max;
};
//平均值
Array.prototype.avg = function () {
  let sum = 0;
  let len = this.length;
  for (let i of this) {
    sum = sum + i;
  }
  return sum / len;
};



app.use(createPinia());
app.use(router);
app.use(vant)
app.use(Icon)

app.mount("#app");
